﻿@{
    ViewBag.Title = "Login";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Login Page | Amaze UI Example</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="alternate icon" type="image/png" href="assets/i/favicon.png">
    <link href="~/Scripts/bower_components/amazeui/dist/css/amazeui.min.css" rel="stylesheet"/>
    <style>
        .header { text-align: center; }

        .header h1 {
            color: #333;
            font-size: 200%;
            margin-top: 30px;
        }

        .header p { font-size: 14px; }


    </style>
</head>
<body>
<div class="header">
    <div class="am-g">
        <h1 style="color: cadetblue; font-size: 50px;">online learning</h1>
    </div>
    <hr/>
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">

        <h2 style="color: cadetblue; font-size: 20px;">log in,please↖(^ω^)↗</h2>


        <br>
        <br>

        <form method="post" class="am-form" action="">
            <label for="text">学号:</label>
            <input type="text" name="num" id="StudentNum" maxlength="9" value="">
            <br>
            <label for="password">密码:</label>
            <input type="password" name="password" id="password" value="">
            <br>
            <label for="remember-me">
                <input id="remember-me" type="checkbox">
                记住密码
            </label>
            <br/>
            <div class="am-cf">
                <input type="button" id="logbutton" name="" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl">
                <input type="submit" name="" value="忘记密码 ^_^? " class="am-btn am-btn-default am-btn-sm am-fr">
            </div>
        </form>
        <hr>
    </div>
</div>


<script src="~/Scripts/bower_components/jquery/dist/jquery.js"></script>
<script>
    $(function() {
        $("#logbutton").click(function() {
            var a = $("#StudentNum").val();
            var b = $("#password").val();
            if (a == "" || b == "")
                alert("请正确输入账户密码！");
            else
                $.ajax({
                    url: "/Common/Base/Login",
                    data: {
                        num: a,
                        password: b
                    },
                    success: function(res) {
                        if (res == 0) {
                            alert("用户名或密码错误");
                        } else {
                            window.location.href = "/students/index/index";
                        }
                    }
                });
        });
    });

</script>
</body>

</html>